package com.jse.io.nio.buffers;

import java.nio.ByteBuffer;

import org.junit.Test;

public class ByteBufferTest {
	
	@Test
	public void testPosition() {
		ByteBuffer buffer = ByteBuffer.allocate(2);
		buffer.put("aa".getBytes());
		
//		ByteBuffer buffer = ByteBuffer.wrap("hello".getBytes());
//		buffer.allocate(1024);
//		buffer.flip();
//		buffer.reset();
//		buffer.remaining();
//		buffer.rewind();
		System.out.println(buffer.isDirect());
		System.out.println("position: " + buffer.position());
		System.out.println("limit: " + buffer.limit());
		System.out.println("capacity: " + buffer.capacity());
	}
}
